package com.ls.aop.security;

import org.apache.commons.lang3.StringUtils;

public class CurrentUserHolder {

	private static  ThreadLocal<String> currentUser = new ThreadLocal<>();
	
	public static String getCurrentUser() {
		String user = currentUser.get();
		if(StringUtils.isBlank(user)) {
			return "unknow";
		}
		return user;
				
	}
	
	public static void setCurrentUser(String name) {
		currentUser.set(name);
	}
	
	
}
